<!-- 发送请求 -->
<button onclick="loadDoc()">Change Content</button>
<div id="demo">Let AJAX change this text</div>

<script>
function loadDoc() {
  var xhttp;
  if (window.XMLHttpRequest) { // code for modern browsers
    xhttp = new XMLHttpRequest();
  } else { // code for IE6, IE5
    xhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      document.getElementById("demo").innerHTML = this.responseText;
    }
  };
  xhttp.open("GET", "ajax_info.txt", true);
  xhttp.send();
}
</script>